home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / cpost_1_4.lha / cposthdr.bak < prev    next >
Text File  |  1995-05-09  |  15KB  |  466 lines

  1. /*------------------------------------------------------------------
  2.  * cposthdr.h : default postscript header for cPost output
  3.  *------------------------------------------------------------------
  4.  * 02-01-93 originally by Patrick J. Mueller
  5.  *------------------------------------------------------------------*/
  6.  
  7. static char *Header_1[] =
  8.    {
  9.    "%%-----------------------------------------------------------------",
  10.    "%% font names and sizes",
  11.    "%%-----------------------------------------------------------------",
  12.    "",
  13.    "/Inch { 72    mul } def",
  14.    "/Cm   { 28.35 mul } def",
  15.    "/Mm   { 2.835 mul } def",
  16.    "",
  17.    "/nFontName /Courier              def % font name for normal text",
  18.    "/kFontName /Times-BoldItalic     def % font name for keywords",
  19.    "/iFontName /Courier              def % font name for identifiers",
  20.    "/fFontName /Times-Bold           def % font name for functions",
  21.    "/dFontName /Times-Bold           def % font name for function definitions",
  22.    "/cFontName /Courier-Oblique      def % font name for comments",
  23.    "/pFontName /Helvetica            def % font name for preprocessor",
  24.    "/lFontName /Courier              def % font name for line numbers",
  25.    "",
  26.    "/nFontSize  6                    def % font size for normal text",
  27.    "/kFontSize  6                    def % font size for keywords",
  28.    "/iFontSize  6                    def % font size for identifiers",
  29.    "/fFontSize  9                    def % font size for functions",
  30.    "/dFontSize  9                    def % font size for function definitions",
  31.    "/cFontSize  6                    def % font size for comments",
  32.    "/pFontSize  6                    def % font size for preprocessor",
  33.    "/lFontSize  5                    def % font size for line numbers",
  34.    "",
  35.    "%%-----------------------------------------------------------------",
  36.    "%% colors",
  37.    "%%-----------------------------------------------------------------",
  38.    "/nColor [ 0 0 0 ]                def % color for normal text",
  39.    "/kColor [ 0 0 0 ]                def % color for keywords",
  40.    "/iColor [ 0 0 0 ]                def % color for identifiers",
  41.    "/fColor [ 0 0 0 ]                def % color for functions",
  42.    "/dColor [ 0 0 0 ]                def % color for function definitions",
  43.    "/cColor [ 0 0 0 ]                def % color for comments",
  44.    "/pColor [ 0 0 0 ]                def % color for preprocessor",
  45.    "/lColor [ 0 0 0 ]                def % color for line numbers",
  46.    "",
  47.    "",
  48.    "%%------------------------------------------------------------------",
  49.    "%% page size, margin size",
  50.    "%%------------------------------------------------------------------",
  51.    "/pLength   11     Inch           def % page length",
  52.    "/pWidth     8.5   Inch           def % page width",
  53.    "",
  54.    "/lMargin     .5   Inch           def % margin: left",
  55.    "/rMargin     .5   Inch           def % margin: right",
  56.    "/tMargin     .75  Inch           def % margin: top",
  57.    "/bMargin     .75  Inch           def % margin: bottom",
  58.    "",
  59.    "%%------------------------------------------------------------------",
  60.    "%% header (and footer) info",
  61.    "%%------------------------------------------------------------------",
  62.    "/yh1 pLength .65 Inch sub def",
  63.    "/yh2 pLength .5  Inch sub def",
  64.    "/yh3 .65  Inch def",
  65.    "/yh4 .45  Inch def",
  66.    "",
  67.    "%%------------------------------------------------------------------",
  68.    "%% print a header and footer for odd numbered pages",
  69.    "%%------------------------------------------------------------------",
  70.    "/header1",
  71.    "   {",
  72.    "   lColor aload pop setrgbcolor",
  73.    "   newpath",
  74.    "      lMargin            yh1 moveto",
  75.    "      pWidth rMargin sub yh1 lineto",
  76.    "   stroke",
  77.    "",
  78.    "   /Times-Roman findfont 14 scalefont setfont",
  79.    "",
  80.    "   lMargin yh2 moveto",
  81.    "   currFunc show",
  82.    "",
  83.    "   /numberBuffer 10 string def",
  84.    "   pWidth rMargin                           sub",
  85.    "   pageNum numberBuffer cvs stringwidth pop sub",
  86.    "   (page ) stringwidth pop                  sub",
  87.    "   yh2 moveto",
  88.    "   (page ) show numberBuffer show",
  89.    "",
  90.    "   newpath",
  91.    "      lMargin yh3 moveto",
  92.    "      pWidth rMargin sub yh3 lineto",
  93.    "   stroke",
  94.    "",
  95.    "   /Helvetica findfont 7 scalefont setfont",
  96.    "",
  97.    "   lMargin yh4 moveto",
  98.    "   (Print date: ) show",
  99.    "   printDate show",
  100.    "",
  101.    "   lMargin 2 Inch add yh4 moveto",
  102.    "   (File date: ) show",
  103.    "   fileDateTime show",
  104.    "",
  105.    "   /Times-Roman findfont 14 scalefont setfont",
  106.    "",
  107.    "   pWidth rMargin           sub",
  108.    "   fileName stringwidth pop sub",
  109.    "",
  110.    "   yh4 moveto",
  111.    "   fileName show",
  112.    "   }",
  113.    "   def",
  114.    "",
  115.    "%%------------------------------------------------------------------",
  116.    "%% print a header and footer for even numbered pages",
  117.    "%%------------------------------------------------------------------",
  118.    "/header2",
  119.    "   {",
  120.    "   lColor aload pop setrgbcolor",
  121.    "   newpath",
  122.    "      lMargin            yh1 moveto",
  123.    "      pWidth rMargin sub yh1 lineto",
  124.    "   stroke",
  125.    "",
  126.    "   /Times-Roman findfont 14 scalefont setfont",
  127.    "",
  128.    "   pWidth rMargin           sub",
  129.    "   currFunc stringwidth pop sub",
  130.    "   yh2 moveto",
  131.    "   currFunc show",
  132.    "",
  133.    "   /numberBuffer 10 string def",
  134.    "   pageNum numberBuffer cvs pop",
  135.    "   lMargin yh2 moveto",
  136.    "   (page ) show numberBuffer show",
  137.    "",
  138.    "   newpath",
  139.    "      lMargin yh3 moveto",
  140.    "      pWidth rMargin sub yh3 lineto",
  141.    "   stroke",
  142.    "",
  143.    "   /Helvetica findfont 7 scalefont setfont",
  144.    "",
  145.    "   4 Inch yh4 moveto",
  146.    "   (Print date: ) show",
  147.    "   printDate show",
  148.    "",
  149.    "   6 Inch yh4 moveto",
  150.    "   (File date: ) show",
  151.    "   fileDateTime show",
  152.    "",
  153.    "   /Times-Roman findfont 14 scalefont setfont",
  154.    "",
  155.    "   lMargin yh4 moveto",
  156.    "   fileName show",
  157.    "   }",
  158.    "   def",
  159.    "",
  160.    "%%------------------------------------------------------------------",
  161.    "%% user defined from imbed file",
  162.    "%%------------------------------------------------------------------",
  163.    "",
  164.    };
  165.  
  166. static char *Header_2[] =
  167.    {
  168.    "",
  169.    "%%------------------------------------------------------------------",
  170.    "%% define actual header procs to use",
  171.    "%%------------------------------------------------------------------",
  172.    "/Header1 { header1 } def",
  173.    "/Header2 { oDuplex { header2 } { header1 } ifelse } def",
  174.    "",
  175.    "%%------------------------------------------------------------------",
  176.    "%% define our fonts to shorter names",
  177.    "%%------------------------------------------------------------------",
  178.    "/nFont nFontName findfont nFontSize scalefont def",
  179.    "/kFont kFontName findfont kFontSize scalefont def",
  180.    "/iFont iFontName findfont iFontSize scalefont def",
  181.    "/fFont fFontName findfont fFontSize scalefont def",
  182.    "/dFont dFontName findfont dFontSize scalefont def",
  183.    "/cFont cFontName findfont cFontSize scalefont def",
  184.    "/pFont pFontName findfont pFontSize scalefont def",
  185.    "/lFont lFontName findfont lFontSize scalefont def",
  186.    "",
  187.    "%%------------------------------------------------------------------",
  188.    "%% define our fonts to REAL short names",
  189.    "%%------------------------------------------------------------------",
  190.    "/n { nColor nFont nFontSize } def",
  191.    "/k { kColor kFont kFontSize } def",
  192.    "/i { iColor iFont iFontSize } def",
  193.    "/f { fColor fFont fFontSize } def",
  194.    "/d { dColor dFont dFontSize } def",
  195.    "/c { cColor cFont cFontSize } def",
  196.    "/p { pColor pFont pFontSize } def",
  197.    "/l { lColor lFont lFontSize } def",
  198.    "",
  199.    "%%-----------------------------------------------------------------",
  200.    "%% max function",
  201.    "%%-----------------------------------------------------------------",
  202.    "/max",
  203.    "   {",
  204.    "   2 copy",
  205.    "   lt { exch } if",
  206.    "   pop",
  207.    "   } def",
  208.    "",
  209.    "%%-----------------------------------------------------------------",
  210.    "%% maximum line height",
  211.    "%%-----------------------------------------------------------------",
  212.    "/maxLineHeight",
  213.    "   nFontSize",
  214.    "   kFontSize max",
  215.    "   iFontSize max",
  216.    "   fFontSize max",
  217.    "   d